package com.hrms.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hrms.dao.EmployeeDao;
import com.hrms.pojo.Employee;
import com.hrms.service.EmployeeService;

@Service("employeeService")
public class EmployeeServiceImpl implements EmployeeService {

	@Resource
	private EmployeeDao employeeDao;

	@Override // 根据id查找
	public Employee getEmpById(int emId) {
		return employeeDao.selectEmpById(emId);
	}

	@Override // 根据名字模糊查找
	public List<Employee> getEmpByName(String emName) {
		return employeeDao.selectEmpByName(emName);
	}

	@Override // 根据身份证号查找
	public Employee getEmpByIdNumber(String emIdNumber) {
		return employeeDao.selectEmpByIdNumber(emIdNumber);
	}

	@Override // 查找所有员工
	public List<Employee> getEmpAll() {
		return employeeDao.selectEmpAll();
	}

	@Override // 添加员工信息
	public int addEmp(Employee em) {
		return employeeDao.insertEmp(em);
	}

	@Override // 修改员工信息
	public int alterEmp(Employee em) {
		return employeeDao.updateEmp(em);
	}

	@Override // 根据di删除
	public int removeEmpById(int emId) {
		return employeeDao.deleteEmpById(emId);
	}

	@Override // 分页查找
	public List<Employee> getEmpByLimit(int offset, int limit) {
		return employeeDao.selectEmpByLimit(offset, limit);
	}

}
